<?php
require '../Controller/Config.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$delpollId = $_POST['delpoll'];
//echo $_POST["delpoll"]."<br>"; 


//Delte Table Choice
$query = "DELETE FROM `option_scale` WHERE `poll_id`= '".$delpollId."'";
$result = mysql_query($query) or die("Error SQL[ ".$query." ] ".mysql_error());
//Delte Table Choice
$query = "DELETE FROM `choice` WHERE `poll_id`= '".$delpollId."'";
$result = mysql_query($query) or die("Error SQL[ ".$query." ] ".mysql_error());
//Delte Table Occupation
$query = "DELETE FROM `condition` WHERE `poll_id`= '".$delpollId."'";
$result = mysql_query($query) or die("Error SQL[ ".$query." ] ".mysql_error());
//Delte Table Compute
$query = "DELETE FROM `compute` WHERE `poll_id`= '".$delpollId."'";
$result = mysql_query($query) or die("Error SQL[ ".$query." ] ".mysql_error());
//Delte Table Compute
$query = "DELETE FROM `answer` WHERE `poll_id`= '".$delpollId."'";
$result = mysql_query($query) or die("Error SQL[ ".$query." ] ".mysql_error());
//Delte Table Question
$query = "DELETE FROM `question` WHERE `poll_id`= '".$delpollId."'";
$result = mysql_query($query) or die("Error SQL[ ".$query." ] ".mysql_error());

//Delte Table Poll
$query = "DELETE FROM `poll` WHERE `poll_id`= '".$delpollId."'";
$result = mysql_query($query) or die("Error SQL[ ".$query." ] ".mysql_error());







echo '<script>';
echo 'window.location.href = encodeURI("../Interface/MenuCreatePoll.php?")';
echo '</script>';

mysql_free_result($result);
mysql_close();
?>
